#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>
#include<errno.h>
#include<stdlib.h>

#define SIZE 1024
#define NOW_REFRESH 0
#define LINE_REFRESH 1
#define FULL_REFRESH 2


typedef struct _FILE{
    int flag; //刷新方式
    int fileno;//文件fd
    int capacity;//缓冲区大小
    int size;//缓冲区写了多少个了
    char buffer[SIZE];
} _FILE;

_FILE* my_fopen(const char* pathname,const char* mode);

int my_fwrite(void* buff,int num, _FILE* file);

int my_fclose(_FILE* file);